<template>
  <div>
    <h3>银行卡余额：{{ money }}</h3>
    <button @click="money = money + 1000">发工资</button>
    <button @click="money = money + 15">吃饭</button>
    <div>{{ obj }}</div>
    <button @click="obj.age++">ann</button>
  </div>
</template>

<script>
export default {
  components: {},
  props: {},
  data() {
    return {
      money: 100,
      obj: {
        name: "xiao",
        age: 30,
      },
    };
  },
  computed: {},
  watch: {
    money(newVal, oldVal) {
      console.log("你的余额为", newVal, "原", oldVal);
    },
    "obj.age"(newVal, oldVal) {
      console.log("你的余额为", newVal, "原", oldVal);
    },
  },
  created() {},
  methods: {},
};
</script>

<style scoped></style>
